<?php
class memberAction extends Action{
	////报名
	function signup(){
		$hid = intval($_POST['hid']);
		if($hid==11){
			$arr['kecheng_id'] = intval($_POST['kecheng_id']);
			$arr['edu']=addslashes($_POST['edu']);
			$arr['school']=addslashes($_POST['school']);
			$arr['address']=addslashes($_POST['address']);
			$arr['mobile']=addslashes($_POST['mobile']);
			$arr['state']=addslashes(implode(',',$_POST['state']));
			$arr['like']=addslashes(implode(',',$_POST['like']));
			$arr['qq']=addslashes($_POST['qq']);
			$arr['email']=addslashes($_POST['email']);
			$arr['work']=addslashes($_POST['work']);
			$arr['about']=addslashes($_POST['about']);
			
			$user = D('signup');
			$re = $user->add($arr);
			$re = true;
			if($re){
				//error_reporting(E_ALL);
				error_reporting(E_STRICT);
				date_default_timezone_set('Asia/Shanghai');
				include("semail/class.phpmailer.php");
				$mail             = new PHPMailer();
				foreach($arr as $v){
				   $body .= $v . '<BR>';
				}
				$body             = eregi_replace("[\]",'',$body);
				
				$mail->IsSMTP();
				$mail->SMTPAuth   = true;                  // enable SMTP authentication
				$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
				$mail->Host       = "smtp.qq.com";      // sets GMAIL as the SMTP server
				$mail->Port       = 465;                   // set the SMTP port for the GMAIL server
				$mail->Username   = "1135287226@qq.com";  // GMAIL username
				$mail->Password   = "wyflyaway";            // GMAIL password
				$mail->AddReplyTo("1135287226@qq.com");
				$mail->From       = "1135287226@qq.com";
				$mail->FromName   = "PHP培训师";
				$mail->Subject    = "报名了!";
				//$mail->Body       = "Hi,<br>This is the HTML BODY<br>";                      //HTML Body
				$mail->AltBody    = "此Email需要在支持HTML模式下查看!"; // optional, comment out and test
				$mail->WordWrap   = 50; //自动换行
				$mail->MsgHTML($body);
				$mail->AddAddress("568142527@qq.com");
				//$mail->AddAttachment("images/phpmailer.gif");     // 附件
				$mail->IsHTML(true); //以HTML格式发送
				if($mail->SendEE()){
					$ss = "你的信息已经发送成功!";
				}else{
					$ss = "发送出现问题，请重试!";
				}
				
				pubAction::get_slist();
				$this->assign('title',$ss);
				$this->display('default@signup_ok');
				die();
			}
		}
		
		include('Conf/arr.php');
		$this->assign('like',explode(',',$like));
		$this->assign('state',explode(',',$state));
		$this->assign('title','在线报名');
		$this->display('default@signup');
	}
	
}
?>